﻿using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.Mvc.Routes;

namespace Szmyd.Orchard.Modules.Jumpstart
{
    /// <summary>
    /// Here we define the routing scheme for our module.
    /// If you're coming from ASP.NET MVC development, 
    /// you do basically the same thing as in Global.asax.cs in ordinary ASP.NET MVC app.
    /// </summary>
    public class Routes : IRouteProvider
    {

        public void GetRoutes(ICollection<RouteDescriptor> routes)
        {
            foreach (var routeDescriptor in GetRoutes())
            {
                routes.Add(routeDescriptor);
            }
        }

        public IEnumerable<RouteDescriptor> GetRoutes()
        {
            return new[] {
                
                new RouteDescriptor {
                    Priority = 9,
                    Route = new Route(
                        "Jumpstart",
                        new RouteValueDictionary {
                            {"area", "Szmyd.Orchard.Modules.Jumpstart"},
                            {"controller", "Home"},
                            {"action", "Index"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "Szmyd.Orchard.Modules.Jumpstart"}
                        },
                        new MvcRouteHandler())
                }, new RouteDescriptor {
                    Priority = 9,
                    Route = new Route(
                        "Jumpstart/{controller}/{action}",
                        new RouteValueDictionary {
                            {"area", "Szmyd.Orchard.Modules.Jumpstart"},
                            {"controller", "Home"},
                            {"action", "Index"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "Szmyd.Orchard.Modules.Jumpstart"}
                        },
                        new MvcRouteHandler())
                }
            };
        }
    }
}